<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org/">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
	<title>天天生鲜-登录</title>
	<link rel="stylesheet" type="text/css" href="/css/reset.css">
	<link rel="stylesheet" type="text/css" href="/css/main.css">
	<link rel="stylesheet" type="text/css" href="/layui/css/layui.css">
</head>
<body>
	<div class="login_top clearfix">
		<a href="/" class="login_logo"><img src="/images/logo02.png"></a>
	</div>

	<div class="login_form_bg">
		<div class="login_form_wrap clearfix">
			<div class="login_banner fl"></div>
			<div class="slogan fl">日夜兼程 · 急速送达</div>
			<div class="login_form fr">
				<div class="login_title clearfix">
					<h1>用户登录</h1>
					<a href="/page/register">立即注册</a>
				</div>
				<div class="form_input">

					<form  method="post" class="layui-form" action="">
						<input type="text" name="name" class="name_input" placeholder="请输入用户名">
						<div class="user_error">输入错误</div>
						<input type="password" name="password" class="pass_input" placeholder="请输入密码">
						<div class="pwd_error">输入错误</div>
						<div class="more_input clearfix">
							<input type="checkbox" name="">
							<label>记住用户名</label>
							<a href="#">忘记密码</a>
						</div>
						<input type="submit" name="" value="登录"  class="input_submit" lay-submit lay-filter="submit">
					</form>

				</div>
			</div>
		</div>
	</div>

	<div class="footer no-mp">
		<div class="foot_link">
			<a href="#">关于我们</a>
			<span>|</span>
			<a href="#">联系我们</a>
			<span>|</span>
			<a href="#">招聘人才</a>
			<span>|</span>
			<a href="#">友情链接</a>		
		</div>
		<p>CopyRight © 2016 北京天天生鲜信息技术有限公司 All Rights Reserved</p>
		<p>电话：010-****888    京ICP备*******8号</p>
	</div>

	<script src="/jquery-2.1.4.js"></script>
	<script src="/layui/layui.js"></script>
	<script src="/mylayer.js"></script>

	<script type="text/javascript">
		layui.use(['form'],function () {
			var form = layui.form;

			var queryString = window.location.search;
			var urlParams = new URLSearchParams(queryString);
			var returnUri = urlParams.get("returnUri");

			//绑定提交事件
			form.on('submit(submit)',function (data) {
				var field = data.field;//获取表单字段值
				console.log(data);
				$.post(
					'/user/login',
					field,
					function (result) {
						if (result.code == 0){
							mylayer.okUrl(result.msg,returnUri);
						} else {
							mylayer.errorMsg(result.msg);
						}
					},
					'json'
				);
				return false;
			});

		});
	</script>
	
</body>
</html>